<template>
	<view class="content" style="background-color: #f5f5f5;">
		<u-navbar scrollable=false titleStyle="font-size:40rpx;color:#333" :placeholder='true' :title="title"
			:autoBack="true">
		</u-navbar>
		<view class="input">
			<view class="title co3 fontS32">请设置6位数{{type==5?'账户':"支付"}}密码</view>
			<view class="code">
				<u-code-input @finish="finish()"  v-model="value" :maxlength="6" dot></u-code-input>
			</view>
			<!-- <u-keyboard :closeOnClickOverlay="false"  :dotDisabled="true" :tooltip="false" :showTips="false" :showCancel="false" :showConfirm="false" ref="uKeyboard" mode="number" :show="show"></u-keyboard> -->
			
		</view>
	</view>

</template>



<script>
	export default {
		data() {
			return {
				title:'',
				type:2,//设置密码 3修改密码  5设置账户密码
				value: '',
				show: false,
				data:{}, //上一个页面传过来的参数
			}
		},
		onLoad(op) {
			this.data=JSON.parse(op.data)
			this.type=this.data.type;
			if(this.type==2 && this.data.old_pay_pwd){
				this.title='修改密码'
			}else if(this.type==3){
				this.title='修改密码'
			} else if(this.type==2 && uni.getStorageSync('userInfo').is_pay_pwd){
				this.title='忘记密码'
			}else if(this.type==2 ){
			    this.title='设置密码'
			}
			console.log(this.data)
		},
		methods: {
			go() {console.log(12313);},
			finish(){
				let par;
				if(this.type==2){
					 par = {pay_pwd:this.value}
				}else if(this.type==3){
					 par = {now_pay_pwd:this.value}
				}
				// else if(type==5){
				// 	let par = {now_pwd:this.value}
				// }else if(type==4){
				// }
				let data=Object.assign(this.data,par)
				this.$my.go('/pages/my/set/changeAgain?data=' + JSON.stringify(data))
			} 
		}
	}
</script>

<style lang="scss" scoped>
	.content {
		.input {
			height: 100rpx;
			// background-color: tomato;
			margin-top: 200rpx;

			.title {
				// background-color: red;
				text-align: center;
			}

			.code {
				margin-top: 54rpx;
				display: flex;
				justify-content: center;
			}

		}
	}
</style>
